cmake_minimum_required(VERSION 3.1.0)
project(QScreenShot VERSION 0.1.0 LANGUAGES C CXX)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 COMPONENTS Quick Qml Gui Core Widgets REQUIRED)

add_executable(QScreenShot 
                src/ScreenshotHelper.h
                src/ScreenshotHelper.cpp
                main.cpp

                )

target_link_libraries(QScreenShot PRIVATE Qt6::Quick Qt6::Qml Qt6::Gui Qt6::Core Qt6::Widgets)

#qml_resource_files 资源文件
set(qml_resource_files
    "qml/Screenshot.qml"
    "qml/main.qml"
    "qml/CusDragRect.qml"
    )

qt6_add_resources(QScreenShot "qml"
    PREFIX
         "/"
    FILES
        ${qml_resource_files})


